<template>
    <div>
        <h1>dashboard</h1>
        <el-button
            type="primary"
            size="default"
            @click="sendRequest"
        >发送请求</el-button>
    </div>

</template>

<script>
export default {
    methods: {
        sendRequest() {
            const data = { t: 1 };
            const params = new URLSearchParams();
            params.append('t', 1);

            this.axios.post('hello', params)

            this.axios.post('hello1', this.qs.stringify(data))


            this.axios({
                url: 'hello2',
                method: 'POST',
                headers: {
                    'Content-Type': 'application/x-www-form-urlencoded'
                },
                data: data,
                transformRequest: [
                    function (data) {
                        let ret = '';
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&';
                        }
                        return ret;
                    }
                ]

            })

        }
    }
}
</script>

<style>
</style>